<template>
	<view>
		<view style="background: url(https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20230411/e63bcf73858e37c567847ca55821ddfa.png) no-repeat;background-size: 100%;width: 100%;height: 414rpx;">

		</view>
		<view style="width: 92%;position: absolute;top:10rpx;left: 4%;padding-bottom: 30rpx;">
			<view style="width: 690rpx;height: 520rpx;background: url(https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20220329/3ea1faf4d6c844583f7fd2983b63e88.png) no-repeat;background-size: 100%;margin-bottom: 26rpx;box-sizing: border-box;padding: 40rpx 30rpx;position: relative;">
				<view style="overflow: hidden;border-bottom: 1px solid #eeeeee;padding-bottom: 20rpx;">
					<view style="width: 25%;float: left;overflow: hidden;">
						<image @click="fada(userinfo.avatar)" :src="userinfo.avatar" style="width: 136rpx;height: 136rpx;border-radius: 50%;display: block;" mode=""></image>
					</view>
					<view style="width: 75%;float: left;padding: 10rpx 0;">
						<view style="height: 60rpx;line-height: 60rpx;overflow: hidden;">
							<text v-if="userinfo.remark_name!=''" style="color: #000000;font-size: 38rpx;display: inline-block;max-width: 150rpx;font-weight: 600;float: left;" class="yihang">{{userinfo.remark_name}}</text>
							<text v-if="userinfo.remark_name==''" style="color: #000000;font-size: 38rpx;display: inline-block;max-width: 150rpx;font-weight: 600;float: left;" class="yihang">{{userinfo.name}}</text>
							<text v-if="userinfo.voice_user==2" @click="xiugai" class="iconfont icon-xiugai" style="float: left;margin-left: 20rpx;font-size: 26rpx;color: #ccc;margin-top: 6rpx;"></text>

							<text v-if="userinfo.remark_name!=''" style="color: #000000;font-size: 26rpx;display: inline-block;max-width: 100rpx;font-weight: 600;float: left;margin-left: 10rpx;margin-top: 4rpx;" class="yihang">{{userinfo.name}}</text>
							<text style="color: #999999;font-size: 28rpx;float: right;">发布消息：{{userinfo.voice_num || 0}}</text>
						</view>
						<view style="height: 40rpx;line-height: 40rpx;color: #666666;font-size: 28rpx;">
							{{userinfo.client_position_text  || '待完善'}}
						</view>
						<view v-if="userinfo.company!='' || userinfo.position!='' " @click="qiye(userinfo.firm)" style="height: 40rpx;line-height: 40rpx;color: #666666;font-size: 28rpx;">
							<text v-if="userinfo && userinfo.firm!=''">
								<text v-if="userinfo && userinfo.firm && userinfo.firm.id" style="color: #1fb0ac;">{{userinfo.company}}</text>
								<text v-else>{{userinfo.company || '待完善'}}</text>
							</text>
							<text v-if="userinfo.firm==''">
								<text >{{userinfo.company || '待完善'}}</text>
							</text>
							<text v-if="userinfo.position!=''" style="margin-left: 20rpx;">{{userinfo.position || '待完善'}}</text>
						</view>
						<view style="overflow: hidden;">

							<view @click="gz_cj" style="color: #000000;font-size: 26rpx;line-height: 60rpx;font-weight: 600;float: right;height: 60rpx;margin-top: 20rpx;">
								<image v-if="userinfo.is_attention==0" src="@/static/index/icon_collect.png" style="width: 40rpx;height: 40rpx;float: left;margin: 10rpx 0 20rpx; 20rpx" mode=""></image>
								<image v-if="userinfo.is_attention==1" src="@/static/index/icon_collect1.png" style="width: 40rpx;height: 40rpx;float: left;margin: 10rpx 0 20rpx; 20rpx" mode=""></image>
								<text v-if="userinfo.is_attention==1" style="color: #F0AD4E;">已关注用户</text>
								<text v-if="userinfo.is_attention==0">关注该用户</text>
							</view>
							<!-- <view @click="lahei" style="color: #000000;font-size: 26rpx;line-height: 60rpx;font-weight: 600;float: right;height: 60rpx;margin-top: 20rpx;">
								<text >拉黑该用户</text>
							</view> -->
						</view>
					</view>
				</view>
				<view style="overflow: hidden;margin-top: 40rpx;">
					<view v-if="userinfo.show_mobile==1" style="overflow: hidden;">
						<view style="float: left;">
							<view style="line-height: 60rpx;padding-left: 40rpx;position: relative;">
								<image src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20220329/%E5%9B%BE%E5%B1%82%20540%402x.png" style="width: 30rpx;height: 30rpx;position: absolute;top: 15rpx;left: 0;" mode=""></image>
								<text style="color: #333333;font-size: 28rpx;">
									<text>{{userinfo && userinfo.mobile && hideMobile(userinfo.mobile) || '待完善'}}</text>
								</text>
							</view>
						</view>
						<view class="ml20"  @click="openReport" style="float: right;color: #999;font-size: 22rpx;line-height: 60rpx;text-align: right;">
							<!-- <image src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20220329/fb106bd73e61120629c457d1988d7c0.png" style="width: 30rpx;height: 30rpx;float: left;margin-top: 16rpx;margin-right: 6rpx;" mode=""></image> -->
							举报
						</view>
						<view class="ml20" @click="phone" style="float: right;color: #0078FF;font-size: 22rpx;line-height: 60rpx;text-align: right;">
							<!-- <image src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20220329/fb106bd73e61120629c457d1988d7c0.png" style="width: 30rpx;height: 30rpx;float: left;margin-top: 16rpx;margin-right: 6rpx;" mode=""></image> -->
							立即联系
						</view>
						<view @click="cope_phone" style="float: right;color: #0078FF;font-size: 22rpx;line-height: 60rpx;text-align: right;">
							复制电话
						</view>
					</view>
					<view v-if="userinfo && userinfo.show_mobile==0" style="width: 100%;margin: 10rpx auto;line-height: 60rpx;color: #0078FF;font-size: 28rpx;">
						用户不便于展示联系方式
					</view>
					<!-- <view style="overflow: hidden;">
						<view style="width: 75%;float: left;">
							<view style="line-height: 60rpx;padding-left: 40rpx;position: relative;">
								<image src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20220329/%E5%9B%BE%E5%B1%82%20539%402x.png" style="width: 30rpx;height: 30rpx;position: absolute;top: 15rpx;left: 0;" mode=""></image>
								<text style="color: #333333;font-size: 28rpx;">yangliang538084</text>
							</view>
						</view>
						<view style="width: 20%;float: right;color: #001f65;font-size: 22rpx;line-height: 60rpx;">
							<image src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20220329/d3c6d7bc93049cbf65cb1c528db0a09.png" style="width: 30rpx;height: 30rpx;float: left;margin-top: 16rpx;margin-right: 6rpx;" mode=""></image>加为好友
						</view>
					</view>

					<view style="width: 75%;">
						<view style="line-height: 60rpx;padding-left: 40rpx;position: relative;">
							<image src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20220329/%E5%9B%BE%E5%B1%82%20538%402x.png" style="width: 30rpx;height: 30rpx;position: absolute;top: 15rpx;left: 0;" mode=""></image>
							<text style="color: #333333;font-size: 28rpx;">538084@qq.com</text>
						</view>
					</view> -->
					<view style="overflow: hidden;">
						<view style="width:100%;float: left;">
							<view style="line-height: 40rpx;padding-left: 40rpx;position: relative;margin-top: 10rpx;">
								<image src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20220329/%E5%9B%BE%E5%B1%82%20537%402x.png" style="width: 30rpx;height: 30rpx;position: absolute;top: 5rpx;left: 0;" mode=""></image>
								<text style="color: #333333;font-size: 28rpx;" v-if="userinfo">{{userinfo.province+userinfo.city+userinfo.area+userinfo.address  || '待完善'}}</text>
							</view>
						</view>
						<!-- <view style="width: 20%;float: right;color: #001f65;font-size: 22rpx;line-height: 60rpx;">
							<image src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20220329/d57b698a25fe3b5e0187f8dec672f55.png" style="width: 30rpx;height: 30rpx;float: left;margin-top: 16rpx;margin-right: 6rpx;" mode=""></image>查看位置
						</view> -->
					</view>
				</view>
			</view>


			<view style="display: flex;margin: 0 auto 26rpx;">
				<view @click="sixin" style="flex: 1;border: 1px solid #1fb0ac;height: 76rpx;line-height: 80rpx;text-align: center;border-radius: 40rpx;color: #1fb0ac;font-size: 30rpx;margin-right: 20rpx;">
					私信TA
				</view>
				<view @click="phone" style="flex: 1;height: 80rpx;line-height: 80rpx;text-align: center;border-radius: 40rpx;color: #FFFFFF;font-size: 30rpx;background-color: #1fb0ac;">
					拨打电话
				</view>
			</view>
			<view style="color: #000000;font-size: 30rpx;line-height: 80rpx;position: relative;margin: 26rpx auto;">
				他的动态
				<view style="width:60rpx ;height: 6rpx;background-color: #1fb0ac;border-radius: 3rpx;position: absolute;bottom: 0;left: 4.5%;">

				</view>
			</view>
			<view v-for="(item,index) in list" :key='index' style="box-sizing: border-box;padding: 30rpx;background-color: #FFFFFF;margin-top: 26rpx;border-radius: 12rpx;">
				<view @click="tzxq(item.id)" style="overflow: hidden;">
					<view style="width: 18%;float: left;overflow: hidden;">
						<image :src="item.user.avatar" style="width: 92rpx;height: 92rpx;border-radius: 50%;display: block;" mode=""></image>
					</view>
					<view style="width: 82%;float: left;padding: 6rpx 0;">
						<view style="height: 40rpx;line-height: 40rpx;width: 100%;">
							<text v-if="item.user.remark_name!=''" style="color: #000000;font-size: 30rpx;display: inline-block;max-width: 150rpx;font-weight: 600;float: left;" class="yihang">{{item.user.remark_name}}</text>
							<text v-if="item.user.remark_name==''" style="color: #000000;font-size: 30rpx;display: inline-block;max-width: 100rpx;font-weight: 600;float: left;" class="yihang">{{item.user.name}}</text>
							<text v-if="item.user.remark_name!=''" style="color: #000000;font-size: 26rpx;display: inline-block;max-width: 100rpx;font-weight: 600;float: left;margin-left: 10rpx;" class="yihang">{{item.user.name}}</text>

						</view>
						<view style="line-height: 40rpx;color: #999999;font-size: 24rpx;">
							<text v-if="item.user.firm_check==1" style="background: linear-gradient(0deg, #1fb0ac 0%, #5EC4C2 100%);border-radius: 6rpx;color: #FEFEFE;font-size: 20rpx;padding: 0rpx 10rpx;float: left;margin-right: 10rpx;border-radius: 10rpx;">
								已认证
							</text>
							<text v-if="item.user.company!=''">{{item.user.company || ''}}</text>
							<text v-if="item.user.position!=''" style="margin-left: 20rpx;">{{item.user.position || ''}}</text>
						</view>
					</view>
				</view>
				<!-- <view style="line-height: 60rpx;color: #000000;font-size: 30rpx;margin-top: 10rpx;font-weight: 600;">
					新鲜冻虾
				</view> -->
				<view @click="tzxq(item.id)">
					<view style="color: #666666;font-size: 28rpx;line-height: 40rpx;margin-top: 20rpx;" class="erhang">
						{{item.main_content}}
					</view>
					<view style="overflow: hidden;margin-top: 20rpx;" class="tu" v-if="item.main_images">
						<view v-for="(a,b) in item.main_images" :key='b' style="width: 190rpx;height: 190rpx;float: left;border-radius: 16rpx;overflow: hidden;">
							<image :src="a" style="width: 100%;height: 100%;left: 0;" mode="aspectFill"></image>
						</view>

					</view>
				</view>
				<view @click="tzxq(item.id)" style="overflow: hidden;margin: 20rpx 0 0;">
					<text
						style="color: #999999;font-size: 26rpx;float: left;display: block;max-width: 280rpx;line-height: 60rpx;">{{item.create_time}} </text>
						<text style="margin-left: 10rpx;display: inline-block;max-width: 300rpx;float: right;color: #999999;font-size: 26rpx;line-height: 60rpx;" class="yihang">{{item.city || ''}}</text>
				</view>
				<view style="line-height: 80rpx;display: flex;">
					<view style="flex: 1;color: #999999;font-size: 24rpx;box-sizing: border-box;padding-left: 60rpx;position: relative;">
						<image src="@/static/index/icon_collect.png" style="width: 30rpx;height: 30rpx;position: absolute;top: 50%;left: 20rpx;transform: translateY(-50%);" mode=""></image>
						收藏({{item.collect_num  || 0}})

					</view>
					<view style="flex: 1;color: #999999;font-size: 24rpx;box-sizing: border-box;padding-left: 60rpx;position: relative;">
						<image src="@/static/index/icon_comment.png" style="width: 30rpx;height: 30rpx;position: absolute;top: 50%;left: 20rpx;transform: translateY(-50%);" mode=""></image>
						评论({{item.comment_num  || 0}})

					</view>
					<view style="flex: 1;color: #999999;font-size: 24rpx;box-sizing: border-box;padding-left: 60rpx;position: relative;">
						<image src="@/static/index/icon_like.png" style="width: 30rpx;height: 30rpx;position: absolute;top: 50%;left: 20rpx;transform: translateY(-50%);" mode=""></image>
						点赞({{item.like_num  || 0}})

					</view>
				</view>
			</view>
			<view style="text-align: center;margin-top: 50rpx;">
				<image v-if="kk" :src="require('@/static/my/no-data.png')" style="width: 334rpx;"  mode="widthFix"></image>
				<view style="width: 80%;margin: 0 auto;">
					<u-divider color='#717171' bg-color='#f0f2f8' height='80' border-color='#717171' text="暂无数据" v-if="list.length==0"></u-divider>
					<u-divider color='#717171' bg-color='#f0f2f8' height='80' border-color='#717171' text="没有更多了" v-if="list.length>0 && enmpy"></u-divider>
				</view>
			</view>
		</view>

		<uni-popup id="popup" ref="popup1" :type="type_status" :animation="true">
			<view class="" style="background-color: #FFFFFF;padding:20upx 30upx 0;border-radius: 20upx;width: 500rpx;">
				<view
					style="text-align: center;height: 100upx;line-height: 100upx;color: #333333;font-weight: 600;font-size: 32rpx;">
					提示
				</view>
				<view class="popup-content" style="text-align: center;font-size: 28upx;">请授权您的手机号</view>
				<view class="footer">
					<button @click="quxiao2"
						style="flex: 1;background-color: #f3f3f3;color: #333333;margin-right: 20rpx;font-weight: 600;"
						type="default">取消</button>
					<button @getphonenumber="login2" style="flex: 1;background-color: #000000;color: #FFFFFF;"
						open-type="getPhoneNumber">确定</button>

				</view>
			</view>
		</uni-popup>
		<uni-popup id="popup" ref="popup" :type="type_status" :animation="true">
			<view class="" style="background-color: #FFFFFF;padding:20upx 30upx 0;border-radius: 20upx;width: 500rpx;">
				<view
					style="text-align: center;height: 100upx;line-height: 100upx;color: #333333;font-weight: 600;font-size: 32rpx;">
					提示
				</view>
				<view class="popup-content" style="text-align: center;font-size: 28upx;">请授权您的用户信息</view>
				<view class="footer">
					<button @click="quxiao"
						style="flex: 1;background-color: #f3f3f3;color: #333333;margin-right: 20rpx;font-weight: 600;"
						type="default">取消</button>
					<button @click="login" lang="zh_CN" style="flex: 1;background-color: #000000;color: #FFFFFF;"
						open-type="getUserInfo">确定</button>

				</view>
			</view>
		</uni-popup>
		<uni-popup id="popup" ref="popup6" :type="type_status1" :animation="true">
			<view class="" style="background-color: #FFFFFF;padding:20upx 30upx 0;border-radius: 20upx;width: 500rpx;margin:100rpx auto ;">
				<view
					style="text-align: center;height: 100upx;line-height: 100upx;color: #333333;font-weight: 600;font-size: 32rpx;">
					设置备注名
				</view>
				<!-- <view class="popup-content" style="text-align: center;font-size: 30upx;line-height: 80rpx;">数值越大排序越靠前</view> -->
				<input v-model="keywords" type="text" :placeholder="userinfo.remark_name!=''?userinfo.remark_name:'请输入备注名'" style="width:100%;line-height: 80rpx;height: 80rpx;background-color: #eee;border-radius: 10rpx;box-sizing: border-box;padding: 0 20rpx;font-size: 28rpx;color: #666666;">
				<view class="footer">
					<button @click="quxiao3"
						style="flex: 1;background-color: #f3f3f3;color: #333333;margin-right: 20rpx;font-weight: 600;"
						type="default">取消</button>
					<button @click="queding2" lang="zh_CN" style="flex: 1;background-color: #000000;color: #FFFFFF;"
						open-type="getUserInfo">确定</button>
					<!-- <button @click="submitLink" type="default" class="submit">确认提交</button> -->
				</view>
			</view>
		</uni-popup>
		<noLoginToast ref="noLoginToast"/>
		<uni-popup
      class="login-popup"
      mode="center"
      id="popupReport"
      mask-background-color="rgba(0,0,0,0.9)"
      ref="popupReport"
      :type="type_status"
      :animation="true"
    >
      <view class="login_container relative" style="background-color: #FFFFFF;padding:50rpx 44rpx 30rpx;border-radius: 20rpx;">
        <view
          class=""
          style="background-color: #FFFFFF;border-radius: 20rpx;">
          <view style="line-height: 80upx;color: #333333;font-size: 30upx;height: 80rpx;">
            内容描述
          </view>
          <view class="textarea_item">
            <textarea  maxlength="540" placeholder="请输入内容描述(最多540字符)" v-model="reportContent"
            style="width: auto;height: 300rpx;line-height: 40rpx;font-size: 26rpx;" />
          </view>
          <view class="upload">
            <view class="uploadimgcont">
              <view class="uploadimga" v-for="(item,index) in addImgArray_arr" :key="index">
                <view class="delete" @click="imgdelete(index)">
                  <view class="deleteline">
                  </view>
                </view>
                <image @click="fangda(index)" :src="item" mode="aspectFill"></image>
              </view>
              <view  v-if="!addImgArray_arr || addImgArray_arr.length<9" class="uploadimg" @click="chooseImage">
                <image
                  src="@/static/msg/add-photo.png"
                  style="border-radius: 12rpx;" mode=""></image>
              </view>
            </view>
          </view>
        </view>
        <view class="footer1 flex" style="display: flex;align-items: center;justify-content: center;margin-top: 60rpx;">
          <u-button
            style="width: 240rpx;height: 80rpx;
                line-height: 80rpx;
                color: #666;
                border-radius: 80rpx;
                border: 1px solid #d9d9d9;
                background-color: #d9d9d9;
                margin-right: 30rpx;"
            text="取消"
            @click="cancelPopupReport"
            shape="circle"
          ></u-button>
          <u-button
            @click="submitReport"
            style="width: 240rpx;
              height: 80rpx;
              line-height: 80rpx;"
            text="确定"
            shape="circle"
            color="linear-gradient(to right, #1CD19F, #1FB0AC)"
          ></u-button>
        </view>
      </view>
    </uni-popup>
    <uploadImg :singleNum="false" ref="uploadImg" v-model="addImgArray_arr" permissionCameraContent="获取拍照权限是为了能够上传图片" permissionAlbumContent="获取相册权限，是为了能够上传图片" />
    <callPhone ref="callPhone" />
    <report ref="report" />
	</view>
</template>

<script>
import {
		validateNull
	} from '@/common'
	import {
		genTestUserSig
	} from '@/im/debug/GenerateTestUserSig.js';
	import isAuditIos from '@/common/isAuditIos.js'
	const app = getApp();
	import { hideMobile } from '@/common/index.js'
	import TIM from 'tim-wx-sdk/tim-wx-friendship.js';
	import COS from 'cos-wx-sdk-v5';
	export default{
		mixins: [isAuditIos],
		data(){
			return{
				type_status: 'top',
				isChecked: false,
				isLogin: 'login',
				reportId: '',
				reportContent: '',
				addImgArray_arr: [],
				reportParams: {},
				userinfo:{},
				id:'',
				page:1,
				list:[],
				enmpy:false,
				kk:false,
				is_vip:2,
				keywords:'',
				type_status1:'top',
    		isLogin:'login'
			}
		},
		onLoad(option) {
			this.id=option.id
			this.user()
			this.tiezi()
			this.denglu_im()
		},
		onShow() {
			this.user_info()

		},
		onReachBottom: function() {
			console.log(222222222)
			if (this.enmpy) {
				return
			} else {
				this.tiezi()
			}
		},
		methods:{
			async openReport() {
				this.isLogin = 'login'
				let isLogin = await this.$refs.noLoginToast.open()
				if (!isLogin) {
					return
					// this.isLogin = 'mobile'
					// let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					// if (!isHasMobile) {
					// 	return
					// }
				}
				this.$refs.popupReport.open()
			},
			submitReport() {
				if (validateNull(this.reportContent)) {
					return uni.showToast({
						title: '内容不能为空',
						icon: 'none',
						duration: 1000
					})
				}
				if (validateNull(this.addImgArray_arr)) {
					return uni.showToast({
						title: '图片不能为空',
						icon: 'none',
						duration: 1000
					})
				}
				// /api/client/complaint     POST
				// uid=投诉对象id，必传
				// msg=消息，必传
				// img=图片，非必传
				let params = {
					msg: this.reportContent,
					img: this.addImgArray_arr.join(','),
					uid: this.id
				}
				console.log('%c [ params ]-144', 'font-size:13px; background:pink; color:#bf2c9f;', params)
				// return
				this.post('api/client/complaint',params,true).then(res=>{
					if(res.code==1){
						uni.showToast({
							title: '举报成功',
							icon: "none",
							duration: 1000
						})
						this.closePopupReport()
					}else{
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			},
			cancelPopupReport() {
				this.closePopupReport()
			},
			closePopupReport() {
				this.$refs.popupReport.close()
			},
			// 上传图片
			async chooseImage() {
				// let isLogin = await this.$refs.noLoginToast.open()
				// if (!isLogin) {
				// 	return
				// }
				// let stutas = await requestAndroidPermission('android.permission.READ_EXTERNAL_STORAGE')
				// openAppSettingPermissions()
				// console.log('%c [ stutas ]-862', 'font-size:13px; background:pink; color:#bf2c9f;', stutas)
				let that = this
				if (that.addImgArray_arr.length >= 9) {
					uni.showToast({
						icon: 'none',
						title: '最多上传9张图片'
					})
					return
				}
				try {
					console.log('%c [ this.$refs.uploadImg ]-452', 'font-size:13px; background:pink; color:#bf2c9f;', this.$refs.uploadImg)
					this.$refs.uploadImg.open()
				} catch (error) {
					console.log('%c [ error ]-454', 'font-size:13px; background:pink; color:#bf2c9f;', error)
					uni.hideLoading()
				}
			},
			// 删除图片
			imgdelete(index) {
				// this.addimgArray.splice(index, 1)
				this.addImgArray_arr.splice(index, 1)
				// this.addimgArray.splice(index, 1)
			},
			hideMobile,
			fada:function(avatar){
				let arr=[]
				arr.push(avatar)
				uni.previewImage({
					urls: arr,
				});
			},
			xiugai:function(){
				this.$refs.popup6.open()
			},
			quxiao3:function(){
				this.$refs.popup6.close()
			},
			queding2:function(){
				this.$refs.popup6.close()
				this.post('api/client/remark_name',{user_id:this.userinfo.id,name:this.keywords},true).then(res=>{
					if(res.code==1){
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
						this.user()
						this.keywords=''
						this.page=1
						this.list=[]
						this.enmpy=false
						this.kk=false
						this.tiezi()
					}else{
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			},
			quxiao2: function() {
				this.$refs.popup1.close()
			},
			login2: function(e) {
				console.log(e)
				let that = this
				this.$refs.popup1.close()
				uni.login({
					provider: 'weixin',
					success: (code) => {
						console.log(code)
						this.post('api/wechat/phone', {
							code: code.code,
							iv: e.detail.iv,
							encryptedData: e.detail.encryptedData
						}, true).then(res => {
							console.log(res, '123455')
							if (res.code == 1) {
								uni.setStorageSync('mobile', res.data.phoneNumber)
								uni.setStorageSync('mobile2',res.data.mobile2)
								that.denglu_im()
							}

						})

					}
				})
			},
			denglu_im: function() {
				let that=this
				const userID = uni.getStorageSync('mobile2').toString();
				const userSig = genTestUserSig(userID).userSig;
				app.globalData.userInfo = {
					userSig,
					userID
				};

				uni.setStorageSync('userInfo', app.globalData.userInfo);

				// 登录腾讯im
				uni.$TUIKit
					.login({
						userID: userID,
						userSig: userSig
					})
					.then(res => {
						this.$store.commit('setToken', app.globalData.userInfo);

						uni.$TUIKit.on(uni.$TUIKitEvent.CONVERSATION_LIST_UPDATED, this.onConversationListUpdated);
						setTimeout(function(){
							that.getConversationList();
						},500)
					})
					.catch(() => {});
			},
			// 企业认账后跳转
			qiye:function(firm){
				if(firm!=''){
					if(firm.special_manage==1){
						uni.navigateTo({
							url:'qyxq?id='+firm.id+'&name='+firm.name
						})
					}else{
						uni.navigateTo({
							url:'../../../subpages/pages/wuliuqiye/wl_qyxq?id='+firm.id+'&name='+firm.name
						})
					}
				}
			},
			// 私信
			async sixin(){
				let that=this
				let isLogin = await this.$refs.noLoginToast.open()
				if (!isLogin) {
					return
				}
				let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
				if (!isHasMobile) {
					return
				}
					that.post('api/im/im/friend_msg',{client_id:that.userinfo.id},true).then(res=>{
						if(res.code==1){
							uni.setStorageSync('friend_id',res.data.friend_id)
							uni.setStorageSync('friend_name',that.userinfo.name)
							let aid='C2C'+that.userinfo.mobile2.replace('-del', '')
							uni.navigateTo({
							  	url: `/im/chat/chat?conversationID=${aid}`,
							})
						}else if(res.code==211){
							if (this.iosUpAppStore) {
								console.log('%c [ this.iosUpAppStore ]-584', 'font-size:13px; background:pink; color:#bf2c9f;', this.iosUpAppStore)
								uni.showModal({
									title: '提示',
									content: res.msg,
									success: function (res1) {
										if (res1.confirm) {
											uni.navigateTo({
												url:'../../../subpages/pages/vip'
											})
										} else if (res1.cancel) {

										}
									}
								});
							} else {
								uni.setStorageSync('friend_id',res.data.friend_id)
								uni.setStorageSync('friend_name',that.userinfo.name)
								let aid='C2C'+that.userinfo.mobile2.replace('-del', '')
								uni.navigateTo({
										url: `/im/chat/chat?conversationID=${aid}`,
								})
							}

						}
						else{
							uni.showToast({
								title: res.msg,
								icon: "none",
								duration: 1000
							})
						}
					})
			},
			user_info: function() {
				this.post('api/client/info', '', true).then(res => {
					console.log(res)
					if (res.code == 1) {
						this.is_vip = res.data.is_vip
					}
				})
			},
			// 帖子详情
			tzxq:function(id){
				uni.navigateTo({
					url:'wzxq?id='+id
				})
			},
			// 关注用户
			async gz_cj(){
				let isLogin = await this.$refs.noLoginToast.open()
				if (!isLogin) {
					return
				}
				let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
				if (!isHasMobile) {
					return
				}
				this.post('api/client/attention_client',{client_id:this.id},true).then(res=>{
					console.log(res)
					if(res.code==1){
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
						if(res.data){
							this.userinfo.is_attention=1
						}else{
							this.userinfo.is_attention=0
						}
					}else{
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})

			},
			// la拉黑用户
			async lahei(){
				let isLogin = await this.$refs.noLoginToast.open()
				if (!isLogin) {
					return
				}
				let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
				if (!isHasMobile) {
					return
				}
				this.post('api/client/black_client',{client_id:this.id},true).then(res=>{
					console.log(res)
					if(res.code==1){
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
						setTimeout(function(){
							uni.switchTab({
								url:'/pages/index/index'
							})
						},1500)
					}else{
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			},
			async cope_phone(){
				let isLogin = await this.$refs.noLoginToast.open()
				if (!isLogin) {
					return
				}
				let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
				if (!isHasMobile) {
					return
				}
				if(this.userinfo.mobile){

					if(this.is_vip==1){
						let a=this.userinfo.mobile
						uni.setClipboardData({
							data: a,
							success: function () {
								uni.showToast({
									title: '复制成功',
									icon: "none",
									duration: 1000
								})
							}
						});
					}else if(this.is_vip==0){
						if (this.iosUpAppStore) {
							uni.showModal({
								title: '提示',
								content: '只有会员才可以拨打电话,请前去开通会员！',
								success: function (res1) {
									if (res1.confirm) {
										uni.navigateTo({
											url:'../../../subpages/pages/vip'
										})
									} else if (res1.cancel) {

									}
								}
							});
						} else {
							uni.setClipboardData({
								data: String(that.userinfo.mobile),
								success () {
									uni.showToast({
										title: '复制成功',
										icon: "none",
										duration: 1000
									})
								}
							});
						}
					}else if(this.is_vip==2){
						if (this.iosUpAppStore) {
							uni.showModal({
								title: '提示',
								content: '只有会员才可以拨打电话,请前去开通会员！',
								success: function (res1) {
									if (res1.confirm) {
										uni.navigateTo({
											url:'../../../subpages/pages/vip'
										})
									} else if (res1.cancel) {

									}
								}
							});
						} else {
							uni.setClipboardData({
								data: String(that.userinfo.mobile),
								success () {
									uni.showToast({
										title: '复制成功',
										icon: "none",
										duration: 1000
									})
								}
							});
						}
					}
				}else{

				}
			},
			async phone(){
				let isLogin = await this.$refs.noLoginToast.open()
				if (!isLogin) {
					return
				}
				let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
				if (!isHasMobile) {
					return
				}
					if(this.userinfo.mobile){
						if(this.is_vip==1){
							this.callPhone(this.userinfo.mobile)
							// uni.makePhoneCall({
							// 	phoneNumber: this.userinfo.mobile //仅为示例
							// });
						}else if(this.is_vip==0){
							if (this.iosUpAppStore) {
								uni.showModal({
									title: '提示',
									content: '只有会员才可以拨打电话,请前去开通会员！',
									success: function (res1) {
										if (res1.confirm) {
											uni.navigateTo({
												url:'../../../subpages/pages/vip'
											})
										} else if (res1.cancel) {

										}
									}
								});
							} else {
								this.callPhone(this.userinfo.mobile)
							}
						}else if(this.is_vip==2){
							if (this.iosUpAppStore) {
								uni.showModal({
									title: '提示',
									content: '只有会员才可以拨打电话,请前去开通会员！',
									success: function (res1) {
										if (res1.confirm) {
											uni.navigateTo({
												url:'../../../subpages/pages/vip'
											})
										} else if (res1.cancel) {

										}
									}
								});
							} else {
								this.callPhone(this.userinfo.mobile)
							}
						}
					}else{

					}

			},
			callPhone(phoneNumber) {
				console.log(phoneNumber)
				this.$refs.callPhone.open(phoneNumber)
			},
			// phone:function(){
			// 	uni.makePhoneCall({
			// 		phoneNumber: this.userinfo.mobile //仅为示例
			// 	});
			// },
			// 用户信息
			user:function(){
				this.post('api/voice/user',{user_id:this.id},true).then(res=>{
					console.log(res)
					if(res.code==1){
						this.userinfo=res.data
						this.userinfo.client_position_text = this.userinfo.client_position_text.join(',')
					}
				})
			},
			tiezi:function(){
				let data={
					user_id:this.id,
					page:this.page,
					limit:10
				}
				this.post('api/voice/user_voice_list',data,true).then(res=>{
					if(res.code==1){
						if(this.page==1){
							if (res.data.data== null || res.data.data.length == 0) {
								this.kk = true
								this.enmpy = true
								return
							} else if (res.data.data.length < 10) {
								this.enmpy = true
							}
						}else{
							if (res.data.data== null || res.data.data.length == 0) {
								this.enmpy = true
								return
							} else if (res.data.data.length < 10) {
								this.enmpy = true
							}
						}

						this.page++
						this.list.push(...res.data.data)
					}else{
						this.kk = true
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			},
		}
	}
</script>

<style lang="scss">
	.footer {
		display: flex;
		justify-content: space-between;
		border-top: 1px solid #f4f4f4;
		margin-top: 30rpx;
		padding-bottom: 20rpx;

		button {
			margin: 0 auto;
			width: 100%;
			background-color: #19BE6B;
			// width: 200upx;
			border-radius: 10upx;
			font-size: $uni-font-size-sm;
			// padding: 22upx 34upx;
			height: 80upx;
			font-size: 30rpx;
			line-height: 80upx !important;
			// line-height: 1;
			color: #FFFFFF;
		}

		button:after {
			border: 0;
		}
	}
	page{
		background-color: #F8F8F8!important;
		font-family: Demibold;
	}
	.tu>view {
		margin: 10rpx 0;
	}

	.tu>view:nth-child(3n+2) {
		margin: 10rpx 30rpx;
	}
		// 上传图片
.upload {
		// background: #FFFFFF;
		// padding: 0 40rpx;
		// height: 100vh;
		// height: 700upx;

		.title {
			font-size: 30rpx;
			font-weight: bold;
			color: #343434;
			padding-top: 15rpx;
		}

		.uploadimgcont {
			display: flex;
			// justify-content: space-between;
			flex-wrap: wrap;
			// margin-top: 50rpx;
			// margin:30upx 0 136upx;

			.uploadimga {
				width: 186rpx;
				height: 186rpx;
				margin-right: 24upx;
				margin-bottom: 40upx;
				position: relative;

				.delete {
					width: 40rpx;
					height: 40rpx;
					border-radius: 50%;
					background: #5093ff;
					display: flex;
					align-items: center;
					justify-content: space-around;
					position: absolute;
					top: -10upx;
					left: -10upx;
					z-index: 4;

					.deleteline {
						background: #FFFFFF;
						height: 5rpx;
						width: 50%;
					}
				}

				image {
					width: 100%;
					height: 100%;
				}
			}

			.uploadimg {
				width: 120rpx;
				height: 120rpx;
				background: #F9F9F9;
				border-radius: 120rpx;
				// overflow: hidden;
				position: relative;

				image {
					width: 100%;
					height: 100%;
				}

				view {
					position: absolute;
					bottom: 10rpx;
					left: 50%;
					width: 100%;
					text-align: center;
					transform: translateX(-50%);
					font-size: 28rpx;
					color: #404040;
				}
			}
		}

}
.textarea_item {
  padding: 20rpx;
  border: 1rpx solid #ddd;
  margin-bottom: 20rpx;
}
</style>
